app.controller("baseController", function ($scope) {



    //分页控件配置
    $scope.paginationConf = {
        currentPage: 1,
        totalItems: 0,
        itemsPerPage: 5,
        perPageOptions: [5, 10, 20, 30, 40, 50],
        onChange: function () {
            $scope.reloadList();//重新加载
        }
    };

    $scope.reloadList = function () {
        console.log("test")
        //切换页码
        // $scope.findPage($scope.paginationConf.currentPage, $scope.paginationConf.itemsPerPage);
        $scope.search($scope.paginationConf.currentPage, $scope.paginationConf.itemsPerPage);
    }

    $scope.selectedIds = [];
    // $event.target 这个就等价于js中的this
    $scope.updateSelected = function ($event, id) {
        if ($event.target.checked)//如果复选框选中就将这个选中的id放到数组中
        {
            $scope.selectedIds.push(id);
        } else {
            //否者就是没取消选中就将id从数组中删除
            //选获得id在数组数组中的下标
            var index = $scope.selectedIds.indexOf(id);
            $scope.selectedIds.splice(index, 1);
        }
    }
})